package com.csun.cmny.provider.service;

import com.csun.cmny.core.support.IService;
import com.csun.cmny.provider.model.domain.DmcCsunSleepDataAction;
import com.csun.cmny.provider.model.dto.app.AppSleepDateQueryDto;
import com.csun.cmny.provider.model.dto.csunsleep.CsunSleepDataActionQueryDto;
import com.csun.cmny.provider.model.entity.TimeRange;
import com.csun.cmny.provider.model.vo.app.AppSingleDaySleepDataVo;

import java.util.List;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-04-02 10:59
 * @Description: the interface dmc csun sleep data action service
 */
public interface DmcCsunSleepDataActionService extends IService<DmcCsunSleepDataAction> {

    /**
     * app获取当日老人的睡眠数据
     * @param: [date, deviceId]
     * @return: com.csun.cmny.provider.model.vo.app.AppSingleDaySleepDataVo
     */
    AppSingleDaySleepDataVo getAppSingleDaySleepData(AppSleepDateQueryDto appSleepDateQueryDto);

    /**
     * 通过设备id和起止时间段查询翻身数据
     * @param: [csunSleepDataActionQueryDto]
     * @return: java.util.List<com.csun.cmny.provider.model.domain.DmcCsunSleepDataAction>
     */
    List<DmcCsunSleepDataAction> queryCsunSleepDataActionList(CsunSleepDataActionQueryDto csunSleepDataActionQueryDto);

    /**
     * 根据设备id查询最近的一条在床数据
     * @param: [deviceId]
     * @return: com.csun.cmny.provider.model.domain.DmcCsunSleepDataAction
     */
    DmcCsunSleepDataAction getLatestActionDataByDeviceId(Long deviceId);

    /**
     * 统计翻身报警次数
     * @param: [appSleepDateQueryDto]
     * @return: java.lang.Integer
     */
    Integer countActionAlertTimes(AppSleepDateQueryDto appSleepDateQueryDto);
}
